package com.briup.corejava.day09.test;

import com.briup.corejava.day09.pojo.*;

public class BallTest_2 {
    public static void main(String[] args) {
        // 实例化三个球类游戏
        // 使用多态：父类引用指向子类对象
        Ball basketball = new Basketball();
        Ball football = new Football();
        Ball tableTennis = new TableTennis();
        TableTennis t = new TableTennis();
        t.challenge();

        Game game = new Game();
        game.start(basketball);
        game.start(football);
        game.start(tableTennis);
    }
}
